/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projetweb.modeles;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 *
 * @author mankou
 */
@Entity
public class Lignecommande implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    private double prixunitaire;
    private int quantitearticle;
    @OneToOne
    private Commande commande;

    public Lignecommande() {
    }

    public Lignecommande(double prixunitaire, int quantitearticle) {
        this.prixunitaire = prixunitaire;
        this.quantitearticle = quantitearticle;
    }
    
    

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getPrixunitaire() {
        return prixunitaire;
    }

    public void setPrixunitaire(double prixunitaire) {
        this.prixunitaire = prixunitaire;
    }

    public int getQuantitearticle() {
        return quantitearticle;
    }

    public void setQuantitearticle(int quantitearticle) {
        this.quantitearticle = quantitearticle;
    }

    public Commande getCommande() {
        return commande;
    }

    public void setCommande(Commande commande) {
        this.commande = commande;
    }
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Lignecommande)) {
            return false;
        }
        Lignecommande other = (Lignecommande) object;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "projetweb.modeles.Lignecommande[ id=" + id + " ]";
    }
    
}
